package com.mef.smsplat.eterm.bean;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@XmlRootElement(name = "ML_RESULT")
public class MlResult {
	private String flightNo;
	private String cabin;
	/** 航班起飞日期 */
	private String date;
	private String option;
	private String segment;
	private List<MlSegment> mlSegmentList;

	/**
	 * <TOTAL_NUMBER></TOTAL_NUMBER>
	 */
	private int totalNumber;
	/**
	 * <CONTENT></CONTENT>
	 */
	private String content;

	public String getFlightNo() {
		return flightNo;
	}

	@XmlElement(name = "CABIN")
	public String getCabin() {
		return cabin;
	}

	@XmlElement(name = "DATE")
	public String getDate() {
		return date;
	}

	@XmlElement(name = "OPTION")
	public String getOption() {
		return option;
	}

	@XmlElement(name = "TOTAL_NUMBER")
	public int getTotalNumber() {
		return totalNumber;
	}

	@XmlElement(name = "CONTENT")
	public String getContent() {
		return content;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public void setCabin(String cabin) {
		this.cabin = cabin;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public void setOption(String option) {
		this.option = option;
	}

	public void setTotalNumber(int totalNumber) {
		this.totalNumber = totalNumber;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSegment() {
		return segment;
	}

	public void setSegment(String segment) {
		this.segment = segment;
	}

	public List<MlSegment> getMlSegmentList() {
		return mlSegmentList;
	}

	public void setMlSegmentList(List<MlSegment> mlSegmentList) {
		this.mlSegmentList = mlSegmentList;
	}

//	public String toString() {
//
//		StringBuffer info = new StringBuffer();
//		info.append("FlightNumber:" + this.flightNo + "\n");
//		info.append("Cabin:" + this.cabin + "\n");
//		info.append("Date:" + this.date + "\n");
//		info.append("Option:" + this.option + "\n");
//		for(int i=0;i<mlSegmentList.size();i++){
//			List<Passenger> passengerList=mlSegmentList.get(i).getPassengerList();
//			info.append(mlSegmentList.get(i).getOrg()+"-"+mlSegmentList.get(i).getDst());
//			info.append("Passengers:" + "\n");
//			for (Passenger pass : passengerList) {
//				info.append("\t"+pass.getNo() + "\t");
//				info.append(pass.getPassengerName() + "\t");
//				info.append(pass.getPnr() + "\t");
//				info.append(pass.getCabin() + "\t");
//				info.append(pass.getActionCode() + "\t");
//				info.append(pass.getOffice() + "\t");
//				info.append(pass.getDate() + "\t");
//				info.append(pass.getPassengerInfo() + "\t");
//				info.append(pass.getGroup()+"\t");
//				info.append(pass.getGroupNumber()+"\n");
//			}
//		}
//		
//		info.append("TotalNumber:" + this.totalNumber + "\n");
//		return info.toString();
//	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}
}
